package com.ch.home.bean;

/**
 * 点赞记录表
 * Created by CHEN on 2019/8/24.
 */
public class Praise {
    private Integer id;
    private Integer userId;
    private Integer foreignId;//外键id
    private Integer typeId;//类型id

    public Praise() {
    }

    public Praise(Integer id, Integer userId, Integer foreignId, Integer typeId) {

        this.id = id;
        this.userId = userId;
        this.foreignId = foreignId;
        this.typeId = typeId;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getForeignId() {
        return foreignId;
    }

    public void setForeignId(Integer foreignId) {
        this.foreignId = foreignId;
    }

    public Integer getTypeId() {
        return typeId;
    }

    public void setTypeId(Integer typeId) {
        this.typeId = typeId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass( ) != o.getClass( )) return false;

        Praise praise = (Praise) o;

        if (id != null ? !id.equals(praise.id) : praise.id != null) return false;
        if (userId != null ? !userId.equals(praise.userId) : praise.userId != null) return false;
        if (foreignId != null ? !foreignId.equals(praise.foreignId) : praise.foreignId != null) return false;
        return typeId != null ? typeId.equals(praise.typeId) : praise.typeId == null;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode( ) : 0;
        result = 31 * result + (userId != null ? userId.hashCode( ) : 0);
        result = 31 * result + (foreignId != null ? foreignId.hashCode( ) : 0);
        result = 31 * result + (typeId != null ? typeId.hashCode( ) : 0);
        return result;
    }

    @Override
    public String toString() {
        return "Praise{" +
                "id=" + id +
                ", userId=" + userId +
                ", foreignId=" + foreignId +
                ", typeId=" + typeId +
                '}';
    }
}
